package com.wakaka.controller;

import com.wakaka.pojo.Dept;
import com.wakaka.service.FeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class FeignController {

    @Autowired
    private FeignService service;

    @RequestMapping("/queryAll")
    public List<Dept> getAll() {
        return service.queryAll();
    }

    @RequestMapping("/get/{id}")
    public Dept get(@PathVariable("id") long id) {
        return service.get(id);
    }

    @RequestMapping("/add/{name}")
    public int add(String name) {
        return service.add(name);
    }
}
